module TagsHelper
 
 def tag_font_size(id)
   @max_size = tag_max_size
   @tag_size = tag_story_length(id)
   Integer(Float(@tag_size) / Float(@max_size) * 8)
 end
 
 def make_name(name, id)
    name + " (" + tag_story_length(id).to_s + ")"
 end
 
 def tag_story_length(id)
  @tag = Tag.find(id)
  @tag.stories.length
end
 
 def tag_max_size
  @tags = Tag.find(:all)
  @tags.sort_by { |tag| tag.stories.length }
  (@tags.first).stories.length
end
 
end
